<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/pages/inc/includes.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Show User</title>
</head>
<body>
<table>
	<tr>
	<th>iduser</th>
	<th>username</th>
	<th>password</th>
	<th>type</th>
	</tr>
	<c:choose>
	<c:when test="${users ne NULL}">
		<c:forEach var="user" items="${users}">
		<tr>
			<td>${user.iduser }</td>
			<td>${user.username }</td>
			<td>${user.password }</td>
			<td>${user.type }</td>
		</tr>
		</c:forEach>
	</c:when>
	<c:otherwise>
		<tr>
			<td>${user.iduser }</td>
			<td>${user.username }</td>
			<td>${user.password }</td>
			<td>${user.type }</td>
		</tr>
	</c:otherwise>
	</c:choose>
</table>
<c:if test="${users ne null }">
	<form method="POST" action="users/create" target="submitFrame">
	<table>
		<tr>
			<td><label for="username">userName</label></td>
			<td><input id="username" name="username" /></td>
		</tr>
		<tr>
			<td><label for="password">password</label></td>
			<td><input id="password" name="password" type="password" /></td>
		</tr>
		<tr>
			<td><label>type</label></td>
			<td>
				<label><input name="type" type="radio" value="1" checked="checked" />Common</label>
				<label><input name="type" type="radio" value="0" />Admin</label>
			</td>
		</tr>
		<tr><td colspan="2"><input type="submit" value="Create"/></td></tr>	
	</table>
	</form>
	<iframe id="submitFrame" hidden="true"></iframe>
</c:if>
</body>
</html>